home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-04-08 | 24.9 KB | 1,075 lines |
- head 1.12;
- branch ;
- access ;
- symbols patch1:1.12 arc521:1.7;
- locks ; strict;
- comment @ * @;
-
-
- 1.12
- date 88.07.31.18.39.50; author hyc; state Exp;
- branches ;
- next 1.11;
-
- 1.11
- date 88.07.19.15.59.35; author hyc; state Exp;
- branches ;
- next 1.10;
-
- 1.10
- date 88.06.17.15.22.48; author hyc; state Exp;
- branches ;
- next 1.9;
-
- 1.9
- date 88.06.02.16.27.05; author hyc; state Exp;
- branches ;
- next 1.8;
-
- 1.8
- date 88.06.01.19.16.10; author hyc; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 88.06.01.17.36.36; author hyc; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 88.06.01.15.05.12; author hyc; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 88.05.16.15.49.46; author hyc; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 88.04.11.19.03.58; author hyc; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.04.11.19.01.11; author hyc; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.04.11.17.35.34; author hyc; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.04.11.17.24.19; author hyc; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.12
- log
- @Fixed declarations...
- GEMDOS:
- change stack size from 24K to 64K
- add redirection of stdout when run from GEM desktop
- Unix:
- create temp files in /tmp if not otherwise specified
- allow arbitrary names for archives
- @
- text
- @/*
- * $Header: arc.c,v 1.11 88/07/19 15:59:35 hyc Locked $
- */
-
- /* ARC - Archive utility
-
- Version 5.21, created on 04/22/87 at 15:05:21
-
- (C) COPYRIGHT 1985-87 by System Enhancement Associates; ALL RIGHTS RESERVED
-
- By: Thom Henderson
-
- Description:
- This program is a general archive utility, and is used to maintain
- an archive of files. An "archive" is a single file that combines
- many files, reducing storage space and allowing multiple files to
- be handled as one.
-
- Instructions:
- Run this program with no arguments for complete instructions.
-
- Programming notes:
- ARC Version 2 differs from version 1 in that archive entries
- are automatically compressed when they are added to the archive,
- making a separate compression step unecessary. The nature of the
- compression is indicated by the header version number placed in
- each archive entry, as follows:
-
- 1 = Old style, no compression
- 2 = New style, no compression
- 3 = Compression of repeated characters only
- 4 = Compression of repeated characters plus Huffman SQueezing
- 5 = Lempel-Zev packing of repeated strings (old style)
- 6 = Lempel-Zev packing of repeated strings (new style)
- 7 = Lempel-Zev Williams packing with improved hash function
- 8 = Dynamic Lempel-Zev packing with adaptive reset
- 9 = Dynamic Lempel-Zev packing, larger hash table
-
- Type 5, Lempel-Zev packing, was added as of version 4.0
-
- Type 6 is Lempel-Zev packing where runs of repeated characters
- have been collapsed, and was added as of version 4.1
-
- Type 7 is a variation of Lempel-Zev using a different hash
- function which yields speed improvements of 20-25%, and was
- added as of version 4.6
-
- Type 8 is a different implementation of Lempel-Zev, using a
- variable code size and an adaptive block reset, and was added
- as of version 5.0
-
- Type 9 is a slight modification of type 8, first used by Phil
- Katz in his PKARC utilites. The primary difference is the use
- of a hash table twice as large as for type 8, and that this
- algorithm called Squashing, doesn't perform run-length encoding
- on the input data.
-
- Verion 4.3 introduced a temporary file for holding the result
- of the first crunch pass, thus speeding up crunching.
-
- Version 4.4 introduced the ARCTEMP environment string, so that
- the temporary crunch file may be placed on a ramdisk. Also
- added was the distinction bewteen Adding a file in all cases,
- and Updating a file only if the disk file is newer than the
- corresponding archive entry.
-
- The compression method to use is determined when the file is
- added, based on whichever method yields the smallest result.
-
- Language:
- Computer Innovations Optimizing C86
- */
- #include <stdio.h>
- #include "arc.h"
-
- #if UNIX
- #include <sys/types.h>
- #include <sys/stat.h>
- #endif
-
- int strlen();
- void addarc(), delarc(), extarc(), lstarc(), tstarc(), cvtarc(), runarc();
- void abort();
- static void expandlst();
- #if MTS
- void etoa();
- #endif
- #if GEMDOS
- long _stksize = 65536L;
- #endif
- char *strcpy(), *strcat();
- char *makefnam(); /* filename fixup routine */
-
- static char **lst; /* files list */
- static int lnum; /* length of files list */
-
- main(num, arg) /* system entry point */
- int num; /* number of arguments */
- char *arg[]; /* pointers to arguments */
- {
- char opt = 0;/* selected action */
- char *a; /* option pointer */
- void upper();/* case conversion routine */
- char *index();/* string index utility */
- char *envfind(); /* environment searcher */
- int n; /* index */
- char *arctemp2, *calloc(), *mktemp();
- #if GEMDOS
- void exitpause();
- int append;
- #endif
- #if MTS
- fortran void guinfo();
- char gotinf[4];
- #endif
- #if UNIX
- struct stat sbuf;
- #endif
-
- if (num < 3) {
- printf("ARC - Archive utility, Version 5.21, created on 04/22/87 at 15:05:21\n");
- /* printf("(C) COPYRIGHT 1985,86,87 by System Enhancement Associates;");
- printf(" ALL RIGHTS RESERVED\n\n");
- printf("Please refer all inquiries to:\n\n");
- printf(" System Enhancement Associates\n");
- printf(" 21 New Street, Wayne NJ 07470\n\n");
- printf("You may copy and distribute this program freely,");
- printf(" provided that:\n");
- printf(" 1) No fee is charged for such copying and");
- printf(" distribution, and\n");
- printf(" 2) It is distributed ONLY in its original,");
- printf(" unmodified state.\n\n");
- printf("If you like this program, and find it of use, then your");
- printf(" contribution will\n");
- printf("be appreciated. You may not use this product in a");
- printf(" commercial environment\n");
- printf("or a governmental organization without paying a license");
- printf(" fee of $35. Site\n");
- printf("licenses and commercial distribution licenses are");
- printf(" available. A program\n");
- printf("disk and printed documentation are available for $50.\n");
- printf("\nIf you fail to abide by the terms of this license, ");
- printf(" then your conscience\n");
- printf("will haunt you for the rest of your life.\n\n"); */
- #if MSDOS
- printf("Usage: ARC {amufdxerplvtc}[bswnoq][g<password>]");
- #endif
- #if GEMDOS
- printf("Usage: ARC {amufdxerplvtc}[bhswnoq][g<password>]");
- #endif
- #if UNIX
- printf("Usage: arc {amufdxerplvtc}[biswnoq][g<password>]");
- #endif
- #if MTS
- printf("Parameters: {amufdxeplvtc}[biswnoq][g<password>]");
- #endif
- printf(" <archive> [<filename> . . .]\n");
- printf("Where: a = add files to archive\n");
- printf(" m = move files to archive\n");
- printf(" u = update files in archive\n");
- printf(" f = freshen files in archive\n");
- printf(" d = delete files from archive\n");
- printf(" x,e = extract files from archive\n");
- #if !MTS
- printf(" r = run files from archive\n");
- #endif
- printf(" p = copy files from archive to");
- printf(" standard output\n");
- printf(" l = list files in archive\n");
- printf(" v = verbose listing of files in archive\n");
- printf(" t = test archive integrity\n");
- printf(" c = convert entry to new packing method\n");
- printf(" b = retain backup copy of archive\n");
- #if GEMDOS
- printf(" h = hold screen after finishing\n");
- #endif
- #if MTS
- printf(" i = suppress ASCII/EBCDIC translation\n");
- #endif
- #if UNIX
- printf(" i = suppress image mode (translate EOL)\n");
- #endif
- printf(" s = suppress compression (store only)\n");
- printf(" w = suppress warning messages\n");
- printf(" n = suppress notes and comments\n");
- printf(" o = overwrite existing files when");
- printf(" extracting\n");
- printf(" q = squash instead of crunching\n");
- printf(" g = Encrypt/decrypt archive entry\n");
- printf("\nAdapted from MSDOS by Howard Chu\n");
- /*
- * printf("\nPlease refer to the program documentation for");
- * printf(" complete instructions.\n");
- */
- #if GEMDOS
- exitpause();
- #endif
- return 1;
- }
- /* see where temp files go */
- #if !MTS
- arctemp = calloc(1, STRLEN);
- if (!(arctemp2 = envfind("ARCTEMP")))
- arctemp2 = envfind("TMPDIR");
- if (arctemp2) {
- strcpy(arctemp, arctemp2);
- n = strlen(arctemp);
- if (arctemp[n - 1] != CUTOFF)
- arctemp[n] = CUTOFF;
- }
- #if UNIX
- else strcpy(arctemp, "/tmp/");
- #endif
- #if !MSDOS
- {
- static char tempname[] = "AXXXXXX";
- strcat(arctemp, mktemp(tempname));
- }
- #else
- strcat(arctemp, "$ARCTEMP");
- arctemp2 = NULL;
- #endif
- #else
- guinfo("SHFSEP ", gotinf);
- sepchr[0] = gotinf[0];
- guinfo("SCRFCHAR", gotinf);
- tmpchr[0] = gotinf[0];
- arctemp = "-$$$";
- arctemp[0] = tmpchr[0];
- #endif
-
- #if !UNIX
- /* avoid any case problems with arguments */
-
- for (n = 1; n < num; n++) /* for each argument */
- upper(arg[n]); /* convert it to uppercase */
- #else
- /* avoid case problems with command options */
- upper(arg[1]); /* convert to uppercase */
- #endif
-
- /* create archive names, supplying defaults */
- #if UNIX
- if (!stat(arg[2],&sbuf))
- strcpy(arcname,arg[2]);
- else
- makefnam(arg[2],".arc",arcname);
- #else
- makefnam(arg[2], ".ARC", arcname);
- #endif
- /* makefnam(".$$$",arcname,newname); */
- sprintf(newname, "%s.arc", arctemp);
- makefnam(".BAK", arcname, bakname);
-
- /* now scan the command and see what we are to do */
-
- for (a = arg[1]; *a; a++) { /* scan the option flags */
- #if !MTS
- if (index("AMUFDXEPLVTCR", *a)) { /* if a known command */
- #else
- if (index("AMUFDXEPLVTC", *a)) {
- #endif
- if (opt)/* do we have one yet? */
- abort("Cannot mix %c and %c", opt, *a);
- opt = *a; /* else remember it */
- } else if (*a == 'B') /* retain backup copy */
- keepbak = 1;
-
- else if (*a == 'W') /* suppress warnings */
- warn = 0;
- #if !DOS
- else if (*a == 'I') /* image mode, no ASCII/EBCDIC x-late */
- image = !image;
- #endif
- #if GEMDOS
- else if (*a == 'H') /* pause before exit */
- hold = 1;
- #endif
-
- else if (*a == 'N') /* suppress notes and comments */
- note = 0;
-
- else if (*a == 'O') /* overwrite file on extract */
- overlay = 1;
-
- else if (*a == 'G') { /* garble */
- password = a + 1;
- while (*a)
- a++;
- a--;
- #if MTS
- etoa(password, strlen(password));
- #endif
- } else if (*a == 'S') /* storage kludge */
- nocomp = 1;
-
- else if (*a == 'K') /* special kludge */
- kludge = 1;
-
- else if (*a == 'Q') /* use squashing */
- dosquash = 1;
-
- else if (*a == '-' || *a == '/') /* UNIX and PC-DOS
- * option markers */
- ;
-
- else
- abort("%c is an unknown command", *a);
- }
-
- if (!opt)
- abort("I have nothing to do!");
-
- /* get the files list set up */
-
- lnum = num - 3; /* initial length of list */
- lst = (char **) calloc((lnum==0) ? 1:lnum,
- sizeof(char *)); /* initial list */
- for (n = 3; n < num; n++)
- lst[n - 3] = arg[n];
-
- for (n = 0; n < lnum;) {/* expand indirect references */
- if (*lst[n] == '@@')
- expandlst(n);
- #if GEMDOS /* redirect stdout from the desktop...*/
- else if (*lst[n] == '>') {
- arctemp2 = (++lst[n]);
- lst[n] = lst[lnum-1]; /* delete this entry */
- lnum--;
- if (arctemp2[0] == '>') {
- append = 1;
- arctemp2++;
- }
- else append = 0;
- }
- #endif
- else
- n++;
- }
- #if GEMDOS
- if (arctemp2)
- freopen(arctemp2,append ? "a" : "w",stdout);
- #endif
-
- /* act on whatever action command was given */
-
- switch (opt) { /* action depends on command */
- case 'A': /* Add */
- case 'M': /* Move */
- case 'U': /* Update */
- case 'F': /* Freshen */
- addarc(lnum, lst, (opt == 'M'), (opt == 'U'), (opt == 'F'));
- break;
-
- case 'D': /* Delete */
- delarc(lnum, lst);
- break;
-
- case 'E': /* Extract */
- case 'X': /* eXtract */
- case 'P': /* Print */
- extarc(lnum, lst, (opt == 'P'));
- break;
-
- case 'V': /* Verbose list */
- bose = 1;
- case 'L': /* List */
- lstarc(lnum, lst);
- break;
-
- case 'T': /* Test */
- tstarc();
- break;
-
- case 'C': /* Convert */
- cvtarc(lnum, lst);
- break;
- #if !MTS
- case 'R': /* Run */
- runarc(lnum, lst);
- break;
- #endif
- default:
- abort("I don't know how to do %c yet!", opt);
- }
- #if GEMDOS
- if (hold)
- exitpause();
- #endif
- return nerrs;
- }
- static void
- expandlst(n) /* expand an indirect reference */
- int n; /* number of entry to expand */
- {
- FILE *lf, *fopen(); /* list file, opener */
- char *malloc(), *realloc(); /* memory managers */
- char buf[100]; /* input buffer */
- int x; /* index */
- char *p = lst[n] + 1; /* filename pointer */
-
- if (*p) { /* use name if one was given */
- makefnam(p, ".CMD", buf);
- if (!(lf = fopen(buf, "r")))
- abort("Cannot read list of files in %s", buf);
- } else
- lf = stdin; /* else use standard input */
-
- for (x = n + 1; x < lnum; x++) /* drop reference from the list */
- lst[x - 1] = lst[x];
- lnum--;
-
- while (fscanf(lf, "%99s", buf) > 0) { /* read in the list */
- if (!(lst =(char **)realloc(lst, (lnum + 1) * sizeof(char *))))
- abort("too many file references");
-
- lst[lnum] = malloc(strlen(buf) + 1);
- strcpy(lst[lnum], buf); /* save the name */
- lnum++;
- }
-
- if (lf != stdin) /* avoid closing standard input */
- fclose(lf);
- }
- @
-
-
- 1.11
- log
- @Fixes from John Gilmore, message date Mon, 4 Jul 88 03:02:43 PDT
- @
- text
- @d2 1
- a2 1
- * $Header: arc.c,v 1.10 88/06/17 15:22:48 hyc Locked $
- d76 5
- d84 1
- d89 1
- a89 1
- long _stksize = 24576;
- d92 1
- a102 1
- char *makefnam(); /* filename fixup routine */
- d110 1
- d116 3
- d211 3
- d221 1
- d243 8
- a250 1
- makefnam(arg[2], ".arc", arcname);
- d325 12
- d340 4
- d392 1
- a392 1
- static
- @
-
-
- 1.10
- log
- @Changed description of 'i' option for Unix.
- @
- text
- @d2 1
- a2 1
- * $Header: arc.c,v 1.9 88/06/02 16:27:05 hyc Locked $
- d171 1
- a171 1
- printf(" i = suppress image mode (translate EOL)");
- d202 4
- a205 1
- strcat(arctemp, mktemp("AXXXXXX"));
- @
-
-
- 1.9
- log
- @Minor fixes & speedups
- @
- text
- @d2 1
- a2 1
- * $Header: arc.c,v 1.8 88/06/01 19:16:10 hyc Locked $
- d85 1
- d171 1
- a171 1
- printf(" i = suppress CRLF to '\\n' translation\n");
- d249 1
- a249 1
- image = 1;
- @
-
-
- 1.8
- log
- @Change compilation conditionals
- @
- text
- @d2 1
- a2 1
- * $Header: arc.c,v 1.7 88/06/01 17:36:36 hyc Locked $
- d292 2
- a293 1
- lst = (char **) calloc(lnum, sizeof(char *)); /* initial list */
- @
-
-
- 1.7
- log
- @Merged Arc 5.21 changes
- @
- text
- @d2 1
- a2 1
- * $Header: arc.c,v 1.6 88/06/01 15:05:12 hyc Locked $
- d79 1
- a79 1
- #ifdef MTS
- d82 1
- a82 1
- #ifdef GEMDOS
- d101 1
- a101 1
- #ifdef GEMDOS
- d104 1
- a104 1
- #ifdef MTS
- d111 1
- a111 1
- printf("(C) COPYRIGHT 1985,86,87 by System Enhancement Associates;");
- d133 2
- a134 2
- printf("will haunt you for the rest of your life.\n\n");
- #ifdef MSDOS
- d137 1
- a137 1
- #ifdef GEMDOS
- d140 1
- a140 1
- #ifdef BSD
- d143 1
- a143 1
- #ifdef MTS
- d153 1
- a153 1
- #ifndef MTS
- d163 1
- a163 1
- #ifdef GEMDOS
- d166 1
- a166 1
- #ifdef MTS
- d169 1
- a169 1
- #ifdef BSD
- d184 1
- a184 1
- #ifdef GEMDOS
- d190 1
- a190 1
- #ifndef MTS
- d200 1
- d203 3
- d214 1
- a214 1
- #ifndef BSD
- d233 1
- a233 1
- #ifndef MTS
- d246 1
- a246 1
- #ifndef DOS
- d250 1
- a250 1
- #ifdef GEMDOS
- d266 1
- a266 1
- #ifdef MTS
- d292 1
- a292 1
- lst = calloc(lnum, sizeof(char *)); /* initial list */
- d336 1
- a336 1
- #ifndef MTS
- d344 1
- a344 1
- #ifdef GEMDOS
- d372 1
- a372 1
- if (!(lst = realloc(lst, (lnum + 1) * sizeof(char *))))
- @
-
-
- 1.6
- log
- @Merged Atari ST changes in.
- @
- text
- @d2 1
- a2 1
- * $Header: arc.c,v 1.5 88/05/16 15:49:46 hyc Locked $
- d5 68
- a72 59
- /*
- * ARC - Archive utility
- *
- * Version 5.20, created on 10/24/86 at 14:56:41
- *
- * (C) COPYRIGHT 1985,86 by System Enhancement Associates; ALL RIGHTS RESERVED
- *
- * By: Thom Henderson
- *
- * Description: This program is a general archive utility, and is used to
- * maintain an archive of files. An "archive" is a single file that combines
- * many files, reducing storage space and allowing multiple files to be
- * handled as one.
- *
- * Instructions: Run this program with no arguments for complete instructions.
- *
- * Programming notes: ARC Version 2 differs from version 1 in that archive
- * entries are automatically compressed when they are added to the archive,
- * making a separate compression step unecessary. The nature of the
- * compression is indicated by the header version number placed in each
- * archive entry, as follows:
- *
- * 1 = Old style, no compression
- * 2 = New style, no compression
- * 3 = Compression of repeated characters only
- * 4 = Compression of repeated characters plus Huffman SQueezing
- * 5 = Lempel-Zev packing of repeated strings (old style)
- * 6 = Lempel-Zev packing of repeated strings (new style)
- * 7 = Lempel-Zev Williams packing with improved hash function
- * 8 = Dynamic Lempel-Zev packing with adaptive reset
- * 9 = Squashing, ala Phil Katz's PKARC
- *
- * Type 5, Lempel-Zev packing, was added as of version 4.0
- *
- * Type 6 is Lempel-Zev packing where runs of repeated characters have been
- * collapsed, and was added as of version 4.1
- *
- * Type 7 is a variation of Lempel-Zev using a different hash function which
- * yields speed improvements of 20-25%, and was added as of version 4.6
- *
- * Type 8 is a different implementation of Lempel-Zev, using a variable code
- * size and an adaptive block reset, and was added as of version 5.0
- *
- * Type 9 is yet another implementation of Lempel-Zev, used originally by
- * Phil Katz in his PKARC utility.
- *
- * Verion 4.3 introduced a temporary file for holding the result of the first
- * crunch pass, thus speeding up crunching.
- *
- * Version 4.4 introduced the ARCTEMP environment string, so that the temporary
- * crunch file may be placed on a ramdisk. Also added was the distinction
- * bewteen Adding a file in all cases, and Updating a file only if the disk
- * file is newer than the corresponding archive entry.
- *
- * The compression method to use is determined when the file is added, based on
- * whichever method yields the smallest result.
- *
- * Language: Computer Innovations Optimizing C86
- */
- d76 3
- a78 3
- int strlen();
- void addarc(), delarc(), extarc(), lstarc(), tstarc(), cvtarc(), runarc();
- void abort();
- d80 1
- a80 1
- void etoa();
- d83 1
- a83 1
- long _stksize=24576;
- d86 3
- d90 2
- a91 2
- int num; /* number of arguments */
- char *arg[]; /* pointers to arguments */
- d93 8
- a100 8
- char opt = 0;/* selected action */
- char *a; /* option pointer */
- char *makefnam(); /* filename fixup routine */
- void upper();/* case conversion routine */
- char *index();/* string index utility */
- char *envfind(); /* environment searcher */
- int n; /* argument index */
- char *arctemp2, *calloc(), *mktemp();
- d105 1
- a105 1
- fortran void guinfo();
- d110 24
- a133 24
- printf("ARC - Archive utility, Version 5.20, created on 10/24/86 at 14:56:41\n");
- /*
- * printf("(C) COPYRIGHT 1985,86 by System Enhancement
- * Associates;"); printf(" ALL RIGHTS RESERVED\n\n");
- * printf("Please refer all inquiries to:\n\n"); printf("
- * System Enhancement Associates\n"); printf(" 21 New
- * Street, Wayne NJ 07470\n\n"); printf("You may copy and
- * distribute this program freely,"); printf(" provided
- * that:\n"); printf(" 1) No fee is charged for such
- * copying and"); printf(" distribution, and\n"); printf(" 2)
- * It is distributed ONLY in its original,"); printf("
- * unmodified state.\n\n"); printf("If you like this program,
- * and find it of use, then your"); printf(" contribution
- * will\n"); printf("be appreciated. You may not use this
- * product in a"); printf(" commercial environment\n");
- * printf("or a governmental organization without paying a
- * license"); printf(" fee of $35. Site\n");
- * printf("licenses and commercial distribution licenses
- * are"); printf(" available. A program\n"); printf("disk
- * and printed documentation are available for $50.\n");
- * printf("\nIf you fail to abide by the terms of this
- * license, "); printf(" then your conscience\n");
- * printf("will haunt you for the rest of your life.\n\n");
- */
- d147 6
- a152 6
- printf("Where: a = add files to archive\n");
- printf(" m = move files to archive\n");
- printf(" u = update files in archive\n");
- printf(" f = freshen files in archive\n");
- printf(" d = delete files from archive\n");
- printf(" x,e = extract files from archive\n");
- d154 1
- a154 1
- printf(" r = run files from archive\n");
- d156 1
- a156 1
- printf(" p = copy files from archive to");
- d158 5
- a162 5
- printf(" l = list files in archive\n");
- printf(" v = verbose listing of files in archive\n");
- printf(" t = test archive integrity\n");
- printf(" c = convert entry to new packing method\n");
- printf(" b = retain backup copy of archive\n");
- d164 1
- a164 1
- printf(" h = hold screen after finishing\n");
- d167 1
- a167 1
- printf(" i = suppress ASCII/EBCDIC translation\n");
- d170 1
- a170 1
- printf(" i = suppress CRLF to '\\n' translation\n");
- d172 4
- a175 4
- printf(" s = suppress compression (store only)\n");
- printf(" w = suppress warning messages\n");
- printf(" n = suppress notes and comments\n");
- printf(" o = overwrite existing files when");
- d177 2
- a178 2
- printf(" q = squash instead of crunching\n");
- printf(" g = Encrypt/decrypt archive entry\n");
- d180 4
- a183 2
- /* printf("\nPlease refer to the program documentation for");
- printf(" complete instructions.\n"); */
- a188 1
-
- d191 1
- a191 1
- arctemp = calloc(1,STRLEN);
- d197 1
- a197 1
- if(arctemp[n-1] != CUTOFF)
- a199 1
-
- d202 1
- a202 1
- guinfo("SHFSEP ", gotinf);
- d285 14
- d306 1
- a306 1
- addarc(num - 3, &arg[3], (opt == 'M'), (opt == 'U'), (opt == 'F'));
- d310 1
- a310 1
- delarc(num - 3, &arg[3]);
- d316 1
- a316 1
- extarc(num - 3, &arg[3], (opt == 'P'));
- d322 1
- a322 1
- lstarc(num - 3, &arg[3]);
- d330 1
- a330 1
- cvtarc(num - 3, &arg[3]);
- d334 1
- a334 1
- runarc(num - 3, &arg[3]);
- d345 33
- @
-
-
- 1.5
- log
- @Normalize all the INT/LONG declarations,
- various MTS stuff, straighten out external routine declarations.
- @
- text
- @d2 1
- a2 1
- * $Header: arc.c,v 1.8 88/04/19 01:37:51 hyc Exp $
- d73 3
- a86 1
- #ifndef BSD
- d88 3
- a91 4
- char *arctemp2, *malloc();
- #ifdef BSD
- int getpid();
- #endif
- d93 2
- a94 2
- fortran guinfo();
- char gotinf[4];
- d125 3
- d151 3
- d167 1
- d170 3
- d175 1
- a176 2
- /* use process id to insure unique temp files */
-
- d178 1
- a178 1
- arctemp = malloc(STRLEN);
- d180 9
- a188 5
- arctemp2 = envfind("TEMP");
- if (arctemp2)
- sprintf(arctemp, "%s.Arc%d", arctemp2, getpid());
- else
- sprintf(arctemp, ".Arc%d", getpid());
- a208 3
- #ifndef BSD
- makefnam(arg[2], ".ARC", arcname);
- #else
- a209 1
- #endif
- d211 1
- a211 1
- sprintf(newname, "%s.ARC", arctemp);
- d230 1
- a230 1
- #ifndef MSDOS
- d234 4
- d314 4
- a317 1
-
- @
-
-
- 1.4
- log
- @another omitted section. Ooops.
- @
- text
- @d2 1
- a2 31
- * $Log: arc.c,v $
- * Revision 1.3 88/04/11 19:01:11 hyc
- * added printf accidentally omitted...
- *
- * Revision 1.2 88/04/11 17:35:34 hyc
- * re-synch with MTS version, add squashing support.
- *
- * Revision 1.1 88/04/11 17:24:19 hyc
- * Initial revision
- *
- * Revision 1.4 87/12/20 03:39:46 hyc
- * Fix command description (MTS vs Unix usage of 'i' flag...)
- *
- * Revision 1.3 87/12/19 04:35:12 hyc
- * Change MTS to MSDOS for #ifdef of printf for image mode...
- *
- * Revision 1.2 87/12/19 04:00:18 hyc
- * MAde #ifdef of image #ifndef MSDOS...
- *
- * Revision 1.1 87/12/19 03:59:14 hyc
- * Initial revision
- *
- * Revision 1.5 87/08/13 17:02:39 hyc
- * Run thru the indent program...
- * Revision 1.4 87/07/30 03:38:15 hyc Minor junk
- *
- * Revision 1.3 87/07/21 11:39:35 hyc minor fixups
- *
- * Revision 1.2 87/07/21 06:23:13 hyc Modified according to the mods made to
- * arc 5.12 for unix.
- *
- d67 7
- d75 1
- a75 1
- INT num; /* number of arguments */
- d81 1
- a81 1
- char *upper();/* case conversion routine */
- d84 3
- a86 1
- INT n; /* argument index */
- d89 1
- a89 1
- LONG getpid();
- d168 1
- a168 1
- arctemp = malloc(256);
- d172 1
- a172 1
- sprintf(arctemp, "%s.Arc%ld", arctemp2, getpid());
- d174 1
- a174 1
- sprintf(arctemp, ".Arc%ld", getpid());
- @
-
-
- 1.3
- log
- @added printf accidentally omitted...
- @
- text
- @d3 3
- d265 3
- @
-
-
- 1.2
- log
- @re-synch with MTS version, add squashing support.
- @
- text
- @d3 3
- d176 1
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d3 3
- d51 9
- a59 6
- * 1 = Old style, no compression 2 = New style, no compression 3 = Compression
- * of repeated characters only 4 = Compression of repeated characters plus
- * Huffman SQueezing 5 = Lempel-Zev packing of repeated strings (old style) 6
- * = Lempel-Zev packing of repeated strings (new style) 7 = Lempel-Zev
- * Williams packing with improved hash function 8 = Dynamic Lempel-Zev
- * packing with adaptive reset
- d71 3
- d136 2
- a137 4
- #ifndef MTS
- printf("Usage: ARC {amufdxerplvtc}[bswno][g<password>]");
- #else
- printf("Parameters: {amufdxeplvtc}[biswno][g<password>]");
- d139 6
- d174 2
- a175 2
- printf("\nPlease refer to the program documentation for");
- printf(" complete instructions.\n");
- d235 1
- a235 2
- else if (*a == 'I')
- /* image mode, no ASCII/EBCDIC x-late */
- d239 1
- a239 2
- else if (*a == 'N')
- /* suppress notes and comments */
- d242 1
- a242 2
- else if (*a == 'O')
- /* overwrite file on extract */
- d253 1
- a253 2
- } else if (*a == 'S')
- /* storage kludge */
- d256 1
- a256 2
- else if (*a == 'K')
- /* special kludge */
- d259 2
- a260 2
- else if (*a == '-' || *a == '/')
- /* UNIX and PC-DOS * option markers */
- @
-